package com.jemmyee.pizza.service;

import java.io.Serializable;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.criterion.DetachedCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.jemmyee.core.dao.Page;
import com.jemmyee.pizza.dao.ICostMaintainDao;
import com.jemmyee.pizza.entity.CostMaintain;

@Repository("costMaintainService")
public class CostMaintainServiceImpl implements ICostMaintainService<CostMaintain>{

	private static final Log log = LogFactory.getLog(CostMaintainServiceImpl.class) ;
	@Autowired
	private ICostMaintainDao costMaintainDao ;
	
	public void delete(CostMaintain entity) {
		costMaintainDao.delete(entity) ;
	}

	public void deleteAll(List<CostMaintain> list) {
		costMaintainDao.deleteAll(list) ;
	}

	public void deleteById(Serializable id) {
		costMaintainDao.deleteById(id) ;
	}

	public List<CostMaintain> findAll() {
		return costMaintainDao.findAll(new CostMaintain());
	}

	public List<CostMaintain> findByCriteria(DetachedCriteria criteria) {
		return costMaintainDao.findByCriteria(criteria);
	}

	public CostMaintain findById(Serializable id) {
		return costMaintainDao.findById(id);
	}

	public List<CostMaintain> findByProperty(String propertyName, Object value) {
		return costMaintainDao.findByProperty(new CostMaintain(), propertyName, value);
	}

	public Page findPageByCriteria(DetachedCriteria detachedCriteria,
			int pageSize, int startIndex,String order) {
		return costMaintainDao.findPageByCriteria(detachedCriteria, pageSize, startIndex, order);
	}

	public void save(CostMaintain entity) {
		costMaintainDao.save(entity) ;
	}

	public void update(CostMaintain entity) {
		costMaintainDao.update(entity) ;
	}

}
